class Solution:
    def combinationSum3(self, k: int, n: int, minNums=1):
        if k == 1:
            if minNums <= n <= 9:
                return [[n]]
            else:
                return []
        if n > 45:
            return []
        allResult = []
        for i in range(minNums, 10):
            if i > n:
                break
            r = self.combinationSum3(k - 1, n - i, i + 1)
            if len(r) > 0:
                for one in r:
                    one.insert(0, i)
                    allResult.append(one)
        return allResult


if __name__ == '__main__':
    so = Solution()
    s = [1, 2, 3]
    r = so.containsDuplicate(s)
    print(r)
